package com.qf.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

/**
 * @author q
 * @version V1.0
 * @date 2022/01/20
 **/
@RestController
@RequestMapping("/site")
public class SiteConController {

    @Autowired
    private RestTemplate restTemplate;

    @GetMapping("/hello/{name}")
    public String hello(@PathVariable String name){
        String url = "http://site-provider/site/helloNacos?name={1}";
        return restTemplate.getForObject(url, String.class, name);
    }

}
